package cn.yh.shop.product.model;

import java.util.List;

public class Page<T> {
	private Integer pageIndex;//当前页
	private Integer pageSize;//页面大小
	private Integer pageCount;//总页数
	private Integer dataTotal;//数据总条数
	private List<T> pageList;//一页中的集合
	
	public Page() {
		super();
	}
	public Page(Integer pageIndex, Integer pageSize, Integer pageCount,
			Integer dataTotal, List<T> pageList) {
		super();
		this.pageIndex = pageIndex;
		this.pageSize = pageSize;
		this.pageCount = pageCount;
		this.dataTotal = dataTotal;
		this.pageList = pageList;
	}
	public Integer getPageIndex() {
		return pageIndex;
	}
	public void setPageIndex(Integer pageIndex) {
		this.pageIndex = pageIndex;
	}
	public Integer getPageSize() {
		return pageSize;
	}
	public void setPageSize(Integer pageSize) {
		this.pageSize = pageSize;
	}
	public Integer getPageCount() {
		return pageCount;
	}
	public void setPageCount(Integer pageCount) {
		this.pageCount = pageCount;
	}
	public Integer getDataTotal() {
		return dataTotal;
	}
	public void setDataTotal(Integer dataTotal) {
		this.dataTotal = dataTotal;
		if(this.dataTotal%this.pageSize==0){
			this.setPageCount(this.dataTotal/this.pageSize);
		}else{
			this.setPageCount(this.dataTotal/this.pageSize+1);
		}
	}
	public List<T> getPageList() {
		return pageList;
	}
	public void setPageList(List<T> pageList) {
		this.pageList = pageList;
	}
	
}
